import { h } from "vue";
import { NTag } from "naive-ui";

export const columns = [
  {
    title: '标题',
    key: 'title',
    width: 100,
    align: 'center',
  },
  {
    title: '内容',
    key: 'content',
    width: 100,
    align: 'center',
  },
  {
    title: '创建人',
    key: 'createUser',
    width: 80,
    align: 'center',
  },
  {
    title: '状态',
    key: 'status',
    width: 50,
    align: 'center',
    render(row) {
      return h(
        NTag as any,
        {
          type: row.status ? 'success' : 'warning',
          round: true,
          size: 'small',
        },
        { default: () => row.status ? '启用' : '禁用'  }
      );
    }
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 120,
    align: 'center',
  },
  {
    title: '更新时间',
    key: 'updateTime',
    width: 120,
    align: 'center',
  },
];
